package com.zjm.servlet.servlet10_safe;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ZJM
 * @date 2024/4/19 22:49
 * <p>
 * 推荐使用局部变量解决线程安全问题
 */
@WebServlet("/safe3")
public class Safe03Servlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String message = "登录成功";
        resp.getWriter().println(message);
    }
}
